/**
 * @author 鍚存倍
 * @since 2022/10/13
 * 13:13
 */
package com.windgo.controller.admin;

import com.windgo.bean.MarketAddress;
import com.windgo.bean.MarketSearchHistory;
import com.windgo.bean.common.BasePageInfo;
import com.windgo.bean.common.BaseRespVo;
import com.windgo.bean.common.CommonData;
import com.windgo.service.HistoryService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin/history")
public class HistoryController {
    @Autowired
    HistoryService historyService;
    /*@RequestMapping("list")
    public BaseRespVo list(BasePageInfo basePageInfo,Integer id) {
        CommonData<MarketSearchHistory> data = historyService.list(basePageInfo, id);
        return BaseRespVo.ok(data);
    }

     */


    @RequestMapping( "list")
    @RequiresPermissions("perms[admin:history:list]")

    public BaseRespVo list(BasePageInfo basePageInfo,Integer userId,String keyword){
        CommonData<MarketSearchHistory> data = historyService.search(basePageInfo, userId, keyword);
        return BaseRespVo.ok(data);
    }
}
